/**
 * 
 */
package org.xiha.wiki.database;

import org.xiha.wiki.domain.Ack;

import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.serial.ClassCatalog;
import com.sleepycat.bind.serial.SerialBinding;
import com.sleepycat.collections.StoredMap;
import com.sleepycat.collections.StoredSortedMap;

/**
 * @author summer
 * 
 */
public class AckView {
    private StoredSortedMap<String, Ack>        ackStoredMap;
    
    public AckView(BasicDatabase db) {
        
        ClassCatalog catalog = db.getJavaCatalog();
        
        EntryBinding<String> ackKeyBinding = new SerialBinding<String>(catalog, String.class);
        
        EntryBinding<Ack> ackDataBinding = new SerialBinding<Ack>(catalog, Ack.class);
        
        ackStoredMap = new StoredSortedMap<String, Ack>(db.getAckDb(), ackKeyBinding, ackDataBinding, true);
       
        
    }
    
    public final StoredSortedMap<String, Ack> getAckStoredMap() {
        return ackStoredMap;
    }
    

}
